//
//  UserInfoDetailHeaderView.m
//  MoXiProject
//
//  Created by 周筱雯 on 2017/6/29.
//  Copyright © 2017年 周筱雯. All rights reserved.
//

#import "UserInfoDetailHeaderView.h"
#import "UserInfoModel.h"
@interface UserInfoDetailHeaderView()

@property (weak, nonatomic) IBOutlet UIImageView *userinfoImg;
@property (weak, nonatomic) IBOutlet UILabel *userinfoName;
@property (weak, nonatomic) IBOutlet UILabel *userinfoSign;

@property (weak, nonatomic) IBOutlet UIImageView *userinfolevleVip;
@end

@implementation UserInfoDetailHeaderView

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

-(void)awakeFromNib{
    
    [super awakeFromNib];
    self.userinfoImg.layer.cornerRadius = self.userinfoImg.width / 2;
    self.userinfoImg.layer.masksToBounds = YES;
}

-(void) setDataSourceForUserInfo:(UserInfoModel *) infoModel{
    [self.userinfoName setText:infoModel.userinfousername];
    [self.userinfoImg sd_setImageWithURL:[NSURL URLWithString:infoModel.userinfoimgPath] placeholderImage:DEF_NORMAL_DEFAULT_IMAGE];
    [self.userinfoSign setText:infoModel.userinfouserSign];
    
    [self.userinfolevleVip setImage:[UIImage imageNamed:[NSString stringWithFormat:@"dengji_vip%ld",(long)[infoModel.userinfolevelFlg integerValue]]]];
}
@end
